﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：YS_LH_TUIKUANXX实体层次
//********************************************************************************//
#region Entity
namespace Entity
{
    using System;
    using System.Xml;
    [Serializable()]
    public class YS_LH_TUIKUANXX
    {

        private decimal m_dec_id;
        /// <summary>
        /// 主键
        /// </summary>
        public decimal ID { get { return m_dec_id; } set { m_dec_id = value; } }

        private string m_str_s_laihanbh;
        /// <summary>
        /// 来函编号
        /// </summary>
        public string S_LAIHANBH { get { return m_str_s_laihanbh; } set { m_str_s_laihanbh = value; } }

        private DateTime? m_DT_d_kaizhangrq;
        /// <summary>
        /// 开账日期
        /// </summary>
        public DateTime? D_KAIZHANGRQ { get { return m_DT_d_kaizhangrq; } set { m_DT_d_kaizhangrq = value; } }

        private double? m_db_n_yingshouje;
        /// <summary>
        /// 应收金额
        /// </summary>
        public double? N_YINGSHOUJE { get { return m_db_n_yingshouje; } set { m_db_n_yingshouje = value; } }

        private double? m_db_n_shishouje;
        /// <summary>
        /// 实收金额
        /// </summary>
        public double? N_SHISHOUJE { get { return m_db_n_shishouje; } set { m_db_n_shishouje = value; } }

        private double? m_db_n_ysj;
        /// <summary>
        /// 用水价
        /// </summary>
        public double? N_YSJ { get { return m_db_n_ysj; } set { m_db_n_ysj = value; } }

        private decimal? m_dec_i_tuikuanjhl;
        /// <summary>
        /// 退款计划量
        /// </summary>
        public decimal? I_TUIKUANJHL { get { return m_dec_i_tuikuanjhl; } set { m_dec_i_tuikuanjhl = value; } }

        private string m_str_s_tuoshouzt;
        /// <summary>
        /// 托收状态
        /// </summary>
        public string S_TUOSHOUZT { get { return m_str_s_tuoshouzt; } set { m_str_s_tuoshouzt = value; } }

        private double? m_db_n_tuikuanje;
        /// <summary>
        /// 退款金额
        /// </summary>
        public double? N_TUIKUANJE { get { return m_db_n_tuikuanje; } set { m_db_n_tuikuanje = value; } }

        private string m_str_s_tuikuanfphm;
        /// <summary>
        /// 退款发票号码
        /// </summary>
        public string S_TUIKUANFPHM { get { return m_str_s_tuikuanfphm; } set { m_str_s_tuikuanfphm = value; } }

        private decimal? m_dec_i_tuikuanlx;
        /// <summary>
        /// 退款类型
        /// </summary>
        public decimal? I_TUIKUANLX { get { return m_dec_i_tuikuanlx; } set { m_dec_i_tuikuanlx = value; } }

        private string m_str_s_yinhangzh;
        /// <summary>
        /// 银行账号
        /// </summary>
        public string S_YINHANGZH { get { return m_str_s_yinhangzh; } set { m_str_s_yinhangzh = value; } }

        private string m_str_s_kaihuyh;
        /// <summary>
        /// 开户银行
        /// </summary>
        public string S_KAIHUYH { get { return m_str_s_kaihuyh; } set { m_str_s_kaihuyh = value; } }

        private string m_str_s_kaihuhm;
        /// <summary>
        /// 开户户名
        /// </summary>
        public string S_KAIHUHM { get { return m_str_s_kaihuhm; } set { m_str_s_kaihuhm = value; } }

        private decimal? m_dec_i_tuikuanzt;
        /// <summary>
        /// 0:未确认 1:已确认
        /// </summary>
        public decimal? I_TUIKUANZT { get { return m_dec_i_tuikuanzt; } set { m_dec_i_tuikuanzt = value; } }

        private DateTime? m_DT_d_querenrq;
        /// <summary>
        /// 确认时间
        /// </summary>
        public DateTime? D_QUERENRQ { get { return m_DT_d_querenrq; } set { m_DT_d_querenrq = value; } }

        private decimal? m_dec_i_feiyongbh;
        /// <summary>
        /// 对应营业账费用编号
        /// </summary>
        public decimal? I_FEIYONGBH { get { return m_dec_i_feiyongbh; } set { m_dec_i_feiyongbh = value; } }

        private decimal? m_dec_i_jiajiabl;
        /// <summary>
        /// 加价倍率
        /// </summary>
        public decimal? I_JIAJIABL { get { return m_dec_i_jiajiabl; } set { m_dec_i_jiajiabl = value; } }

        private decimal? m_dec_i_dangqian;
        /// <summary>
        /// 是否为当前流程产生的记录 0:否 1:是 用于区分当前与历史记录(退回情况)
        /// </summary>
        public decimal? I_DANGQIAN { get { return m_dec_i_dangqian; } set { m_dec_i_dangqian = value; } }
        public YS_LH_TUIKUANXX()
        {
        }
    }
}
#endregion
#region EntityProcess
namespace BLL.Access
{
    using System;
    using System.Data;
    //using System.Data.OracleClient;
    using Entity;
    using System.Configuration;
    using System.Data.Common;
    using Platform.Data;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    using Oracle.DataAccess;
    public class YS_LH_TUIKUANXXProcess
    {
        #region Field
        protected string conn;
        #endregion
        #region Construction
        public YS_LH_TUIKUANXXProcess() { conn = Platform.Configuration.ConfigHelper.PlatformConnString; }
        #endregion
        #region public

        /// <summary>
        /// 根据YS_LH_TUIKUANXX实体添加或者修改YS_LH_TUIKUANXX信息
        /// </summary>
        public bool InsertOrUpdate(YS_LH_TUIKUANXX YS_LH_TUIKUANXX, OracleTransaction Transaction)
        {
            if (YS_LH_TUIKUANXX.ID == 0)
            {
                InsertYS_LH_TUIKUANXX(YS_LH_TUIKUANXX, Transaction);
            }
            else
            {
                UpdateYS_LH_TUIKUANXX(YS_LH_TUIKUANXX, Transaction);
            }
            return YS_LH_TUIKUANXX.ID == 0 ? false : true;
        }

        /// <summary>
        /// 根据YS_LH_TUIKUANXX实体添加或修改YS_LH_TUIKUANXX信息
        /// </summary>
        public bool InsertOrUpdate(YS_LH_TUIKUANXX YS_LH_TUIKUANXX)
        {
            return InsertOrUpdate(YS_LH_TUIKUANXX, null);
        }



        /// <summary>
        /// 根据YS_LH_TUIKUANXX主键删除YS_LH_TUIKUANXX信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_LH_TUIKUANXX(decimal ID, OracleTransaction Transaction)
        {
            string spName = "CS_DelYS_LH_TUIKUANXX";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        /// 根据YS_LH_TUIKUANXX主键删除YS_LH_TUIKUANXX信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_LH_TUIKUANXX(decimal ID)
        {
            return DeleteYS_LH_TUIKUANXX(ID, null);
        }

        /// <summary>
        /// 根据条件删除YS_LH_TUIKUANXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_LH_TUIKUANXXesDynamic(string WhereClause, OracleTransaction Transaction)
        {
            string spName = "CS_DelYS_LH_TUIKUANXXesDyn";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        /// 根据条件删除YS_LH_TUIKUANXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_LH_TUIKUANXXesDynamic(string WhereClause)
        {
            return DeleteYS_LH_TUIKUANXXesDynamic(WhereClause, null);
        }

        /// <summary>
        /// 根据YS_LH_TUIKUANXX主键选择YS_LH_TUIKUANXX信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_LH_TUIKUANXX信息</returns>
        public YS_LH_TUIKUANXX SelectYS_LH_TUIKUANXX(decimal ID, OracleTransaction Transaction)
        {
            string spName = "CS_SelYS_LH_TUIKUANXX";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                YS_LH_TUIKUANXX YS_LH_TUIKUANXX = PopulateYS_LH_TUIKUANXX(rd);
                rd.Close();
                return YS_LH_TUIKUANXX;
            }
            else
                return null;
        }

        /// <summary>
        /// 根据YS_LH_TUIKUANXX主键选择YS_LH_TUIKUANXX信息
        /// </summary>
        /// <returns>YS_LH_TUIKUANXX信息</returns>
        public YS_LH_TUIKUANXX SelectYS_LH_TUIKUANXX(decimal ID)
        {
            return SelectYS_LH_TUIKUANXX(ID, null);
        }

        /// <summary>
        /// 选择所有YS_LH_TUIKUANXX信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有YS_LH_TUIKUANXX信息</returns>
        public DataTable SelectYS_LH_TUIKUANXXesAll(OracleTransaction Transaction)
        {
            string spName = "CS_SelYS_LH_TUIKUANXXesAll";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            else
                return null;
        }

        /// <summary>
        /// 选择所有YS_LH_TUIKUANXX信息
        /// </summary>
        /// <returns>所有YS_LH_TUIKUANXX信息</returns>
        public DataTable SelectYS_LH_TUIKUANXXesAll()
        {
            return SelectYS_LH_TUIKUANXXesAll(null);
        }

        /// <summary>
        /// 根据条件选择YS_LH_TUIKUANXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_LH_TUIKUANXX信息</returns>
        public DataTable SelectYS_LH_TUIKUANXXesDynamic(string WhereClause, string OrderByExpression, OracleTransaction Transaction)
        {
            string spName = "CS_SelYS_LH_TUIKUANXXesDyn";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            else
                return null;
        }


        /// <summary>
        /// 根据条件选择YS_LH_TUIKUANXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>YS_LH_TUIKUANXX信息</returns>
        public DataTable SelectYS_LH_TUIKUANXXesDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectYS_LH_TUIKUANXXesDynamic(WhereClause, OrderByExpression, null);
        }



        /// <summary>
        /// 根据条件选择YS_LH_TUIKUANXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_LH_TUIKUANXX信息</returns>
        public DataTable SelectYS_LH_TUIKUANXXesDynamic(string WhereClause, string OrderByExpression, int PageIndex, int PageSize, OracleTransaction Transaction)
        {
            string spName = "CS_SelYS_LH_TUIKUANXXesDynPaged";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            else
                return null;
        }


        /// <summary>
        /// 根据条件选择YS_LH_TUIKUANXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>YS_LH_TUIKUANXX信息</returns>
        public DataTable SelectYS_LH_TUIKUANXXesDynamic(string WhereClause, string OrderByExpression, int PageIndex, int PageSize)
        {
            return SelectYS_LH_TUIKUANXXesDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///根据条件更新YS_LH_TUIKUANXX字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_LH_TUIKUANXXesDynamic(string UpdateValue, string WhereClause, OracleTransaction Transaction)
        {
            int result = 0;
            if (UpdateValue == "" || WhereClause == "")
            {
                return 0;
            }
            string spName = "CS_UpdYS_LH_TUIKUANXXDyn";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///根据条件更新YS_LH_TUIKUANXX字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_LH_TUIKUANXXesDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateYS_LH_TUIKUANXXesDynamic(UpdateValue, WhereClause, null);
        }


        #endregion
        #region Private

        private int InsertYS_LH_TUIKUANXX(YS_LH_TUIKUANXX YS_LH_TUIKUANXX, OracleTransaction Transaction)
        {
            string spName = "CS_InsYS_LH_TUIKUANXX";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_LH_TUIKUANXX.S_LAIHANBH;
            storedParams[1].Value = YS_LH_TUIKUANXX.D_KAIZHANGRQ;
            storedParams[2].Value = YS_LH_TUIKUANXX.N_YINGSHOUJE;
            storedParams[3].Value = YS_LH_TUIKUANXX.N_SHISHOUJE;
            storedParams[4].Value = YS_LH_TUIKUANXX.N_YSJ;
            storedParams[5].Value = YS_LH_TUIKUANXX.I_TUIKUANJHL;
            storedParams[6].Value = YS_LH_TUIKUANXX.S_TUOSHOUZT;
            storedParams[7].Value = YS_LH_TUIKUANXX.N_TUIKUANJE;
            storedParams[8].Value = YS_LH_TUIKUANXX.S_TUIKUANFPHM;
            storedParams[9].Value = YS_LH_TUIKUANXX.I_TUIKUANLX;
            storedParams[10].Value = YS_LH_TUIKUANXX.S_YINHANGZH;
            storedParams[11].Value = YS_LH_TUIKUANXX.S_KAIHUYH;
            storedParams[12].Value = YS_LH_TUIKUANXX.S_KAIHUHM;
            storedParams[13].Value = YS_LH_TUIKUANXX.I_TUIKUANZT;
            storedParams[14].Value = YS_LH_TUIKUANXX.D_QUERENRQ;
            storedParams[15].Value = YS_LH_TUIKUANXX.I_FEIYONGBH;
            storedParams[16].Value = YS_LH_TUIKUANXX.I_JIAJIABL;
            storedParams[17].Value = YS_LH_TUIKUANXX.I_DANGQIAN;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            YS_LH_TUIKUANXX.ID = Convert.ToInt32(storedParams[18].Value);
            return result;
        }
        private bool UpdateYS_LH_TUIKUANXX(YS_LH_TUIKUANXX YS_LH_TUIKUANXX, OracleTransaction Transaction)
        {
            string spName = "CS_UpdYS_LH_TUIKUANXX";
            OracleParameter[] storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_LH_TUIKUANXX.S_LAIHANBH;
            storedParams[1].Value = YS_LH_TUIKUANXX.D_KAIZHANGRQ;
            storedParams[2].Value = YS_LH_TUIKUANXX.N_YINGSHOUJE;
            storedParams[3].Value = YS_LH_TUIKUANXX.N_SHISHOUJE;
            storedParams[4].Value = YS_LH_TUIKUANXX.N_YSJ;
            storedParams[5].Value = YS_LH_TUIKUANXX.I_TUIKUANJHL;
            storedParams[6].Value = YS_LH_TUIKUANXX.S_TUOSHOUZT;
            storedParams[7].Value = YS_LH_TUIKUANXX.N_TUIKUANJE;
            storedParams[8].Value = YS_LH_TUIKUANXX.S_TUIKUANFPHM;
            storedParams[9].Value = YS_LH_TUIKUANXX.I_TUIKUANLX;
            storedParams[10].Value = YS_LH_TUIKUANXX.S_YINHANGZH;
            storedParams[11].Value = YS_LH_TUIKUANXX.S_KAIHUYH;
            storedParams[12].Value = YS_LH_TUIKUANXX.S_KAIHUHM;
            storedParams[13].Value = YS_LH_TUIKUANXX.I_TUIKUANZT;
            storedParams[14].Value = YS_LH_TUIKUANXX.D_QUERENRQ;
            storedParams[15].Value = YS_LH_TUIKUANXX.I_FEIYONGBH;
            storedParams[16].Value = YS_LH_TUIKUANXX.I_JIAJIABL;
            storedParams[17].Value = YS_LH_TUIKUANXX.I_DANGQIAN;
            storedParams[18].Value = YS_LH_TUIKUANXX.ID;
            int result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery((OracleTransaction)Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private YS_LH_TUIKUANXX PopulateYS_LH_TUIKUANXX(IDataReader dr)
        {
            YS_LH_TUIKUANXX YS_LH_TUIKUANXX = new YS_LH_TUIKUANXX();
            YS_LH_TUIKUANXX.ID = dr["ID"] == DBNull.Value ? (decimal)0 : (decimal)dr["ID"];
            YS_LH_TUIKUANXX.S_LAIHANBH = dr["S_LAIHANBH"] == DBNull.Value ? null : (string)dr["S_LAIHANBH"];
            YS_LH_TUIKUANXX.D_KAIZHANGRQ = dr["D_KAIZHANGRQ"] == DBNull.Value ? null : (DateTime?)dr["D_KAIZHANGRQ"];
            YS_LH_TUIKUANXX.N_YINGSHOUJE = dr["N_YINGSHOUJE"] == DBNull.Value ? null : (double?)dr["N_YINGSHOUJE"];
            YS_LH_TUIKUANXX.N_SHISHOUJE = dr["N_SHISHOUJE"] == DBNull.Value ? null : (double?)dr["N_SHISHOUJE"];
            YS_LH_TUIKUANXX.N_YSJ = dr["N_YSJ"] == DBNull.Value ? null : (double?)dr["N_YSJ"];
            YS_LH_TUIKUANXX.I_TUIKUANJHL = dr["I_TUIKUANJHL"] == DBNull.Value ? null : (decimal?)dr["I_TUIKUANJHL"];
            YS_LH_TUIKUANXX.S_TUOSHOUZT = dr["S_TUOSHOUZT"] == DBNull.Value ? null : (string)dr["S_TUOSHOUZT"];
            YS_LH_TUIKUANXX.N_TUIKUANJE = dr["N_TUIKUANJE"] == DBNull.Value ? null : (double?)dr["N_TUIKUANJE"];
            YS_LH_TUIKUANXX.S_TUIKUANFPHM = dr["S_TUIKUANFPHM"] == DBNull.Value ? null : (string)dr["S_TUIKUANFPHM"];
            YS_LH_TUIKUANXX.I_TUIKUANLX = dr["I_TUIKUANLX"] == DBNull.Value ? null : (decimal?)dr["I_TUIKUANLX"];
            YS_LH_TUIKUANXX.S_YINHANGZH = dr["S_YINHANGZH"] == DBNull.Value ? null : (string)dr["S_YINHANGZH"];
            YS_LH_TUIKUANXX.S_KAIHUYH = dr["S_KAIHUYH"] == DBNull.Value ? null : (string)dr["S_KAIHUYH"];
            YS_LH_TUIKUANXX.S_KAIHUHM = dr["S_KAIHUHM"] == DBNull.Value ? null : (string)dr["S_KAIHUHM"];
            YS_LH_TUIKUANXX.I_TUIKUANZT = dr["I_TUIKUANZT"] == DBNull.Value ? null : (decimal?)dr["I_TUIKUANZT"];
            YS_LH_TUIKUANXX.D_QUERENRQ = dr["D_QUERENRQ"] == DBNull.Value ? null : (DateTime?)dr["D_QUERENRQ"];
            YS_LH_TUIKUANXX.I_FEIYONGBH = dr["I_FEIYONGBH"] == DBNull.Value ? null : (decimal?)dr["I_FEIYONGBH"];
            YS_LH_TUIKUANXX.I_JIAJIABL = dr["I_JIAJIABL"] == DBNull.Value ? null : (decimal?)dr["I_JIAJIABL"];
            YS_LH_TUIKUANXX.I_DANGQIAN = dr["I_DANGQIAN"] == DBNull.Value ? null : (decimal?)dr["I_DANGQIAN"];
            return YS_LH_TUIKUANXX;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
            }
        }
        #endregion
    }
}
#endregion